home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-01-01 | 1.4 KB | 55 lines | [TEXT/ttxt] |
- ____________________________________________________________________
-
- 4th Dimension Technical Notes
-
- #9 Double clicking in a scrollable area
-
- Written by Dave Dell'Aquila August 24, 1987
-
- Published August 26, 1987
- ____________________________________________________________________
-
- Double clicking in a scrollable area.
- ___________________________________________________________
-
- Double clicking in a list is a common habbit among Macintosh users. This example shows how to
- detect two clicks in the same array element, which is not provided for by 4th Dimension. This will
- only work with scrollable areas.
-
- Case of
- :(Before) `Initialize variables
- vTime:=Current Time
- vSel:=""
- vDelay:=2 `Time in seconds between clicks
- MakeArray `A Global Procedure that creates the array
- :(During)
- Case of
- :(Event1) `Misc events, i.e. checking button status,
- :(Event2) `updating the array
- Else
- If((Current time-vTime<vDelay)&(vSel=List{List}))
- Alert("A Double Click has been detected.")
- Else
- vTime:=Current time
- vSel:=List{List}
- End if
- End case
- End case
-
- vDelay controls the delay between clicks, and must be adjusted depending on the amount of code
- in the During phase. Additional conditions may be added to the If statement to filter out any
- unwanted events, such as button presses. List is the array that is constructed once in the Before
- phase and as needed in the During phases.
-
-
-
-
-
-
-
- #n: Technical Note Title Page #p of x
-
-
-
-
-